//
//  HamatonCarTopSearchVIew.swift
//  hamaton-app
//
//  Created by intyt on 2024/4/1.
//

import UIKit
import SnapKit

class HamatonCarTopSearchView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupUI()
    }
    
    func setupUI() {
        backgroundColor = .clear
        addSubview(titleLabel)
        addSubview(searchBar)
        titleLabel.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.bottom.equalToSuperview()
            make.left.equalToSuperview()
            make.right.equalToSuperview()
            make.height.equalTo(50)
        }
        searchBar.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.bottom.equalToSuperview()
            make.left.equalToSuperview()
            make.right.equalToSuperview()
            make.height.equalTo(50)
        }
    }
    
    lazy var titleLabel: UILabel = {
        let label = UILabel(frame: .zero)
        label.font = Theme.Font.size(54, bold: true)
        label.textColor = UIColor(hex6: 0x22A1E0)
        label.numberOfLines = 1
        label.text = "Hamaton"
        label.textAlignment = .center
        return label
    }()
    
    lazy var searchBar: UISearchBar = {
        let searchBar = UISearchBar(frame: CGRect(x: 20, y: 100, width: 280, height: 30))
        searchBar.searchBarStyle = UISearchBar.Style.minimal
        return searchBar
    }()

}
